import request from '@/utils/request';
// 学科管理-----学科列表
export const getSubjectList = (page, pagesize) => {
    return request({
        method: 'GET',
        url: '/subjects',
        params: {
            page,
            pagesize
        }
    });
};

// 学科管理-----学科添加
export const addSubject = (subjectName, isFrontDisplay) => {
    return request({
        method: 'POST',
        url: '/subjects',
        data: {
            subjectName,
            isFrontDisplay
        }
    });
};

// 学科管理-----学科删除
export const DeleteSubject = (id, data) => {
    return request({
        method: 'DELETE',
        url: `/subjects/${id}`,
        data
    });
};

// 学科管理-----学科修改
export const UpdateSubject = (id, subjectName, isFrontDisplay) => {
    return request({
        method: 'PUT',
        url: `/subjects/${id}`,
        data: {
            id,
            subjectName,
            isFrontDisplay
        }
    });
};

// 学科管理-----搜索
export const SearchSubject = (subjectName, page, pagesize) => {
    return request({
        method: 'GET',
        url: '/subjects',
        params: {
            subjectName,
            page,
            pagesize
        }
    });
};